Trò chơi Tic-Tac-Toe, game đánh caro full source code
53.474 lượt xem;
- PointedAtGameObjectInfo.cs
- UtilityScripts /
- Photon Unity Networking /
- Assets /
- project /
1 using UnityEngine;
2 using System.Collections;
3
4 [RequireComponent(typeof(InputToEvent))]
5 public class PointedAtGameObjectInfo : MonoBehaviour
6 {
7 void OnGUI()
8 {
9 if (InputToEvent.goPointedAt != null)
10 {
11 PhotonView pv = InputToEvent.goPointedAt.GetPhotonView();
12 if (pv != null)
13 {
14 GUI.Label(new Rect(Input.mousePosition.x + 5, Screen.height - Input.mousePosition.y - 15, 300, 30), string.Format("ViewID {0} InstID {1} Lvl {2} {3}", pv.viewID, pv.instantiationId, pv.prefix, (pv.isSceneView) ? "scene" : (pv.isMine) ? "mine" : "owner: " + pv.ownerId));
15 }
16 }
17 }
18
19 }
2 using System.Collections;
3
4 [RequireComponent(typeof(InputToEvent))]
5 public class PointedAtGameObjectInfo : MonoBehaviour
6 {
7 void OnGUI()
8 {
9 if (InputToEvent.goPointedAt != null)
10 {
11 PhotonView pv = InputToEvent.goPointedAt.GetPhotonView();
12 if (pv != null)
13 {
14 GUI.Label(new Rect(Input.mousePosition.x + 5, Screen.height - Input.mousePosition.y - 15, 300, 30), string.Format("ViewID {0} InstID {1} Lvl {2} {3}", pv.viewID, pv.instantiationId, pv.prefix, (pv.isSceneView) ? "scene" : (pv.isMine) ? "mine" : "owner: " + pv.ownerId));
15 }
16 }
17 }
18
19 }